字串小幫手 on linux


Posted by Rich on 2021-08-10

grep

grep 是把資料裡面有我們要的關鍵字那整行取下來。

  • grep 的幾個指令:
    • -a:將 binary 以 text 檔案的方式進行搜尋
    • -c:計算找到‘搜尋字串’的次數
    • -i:忽略大小寫差異
    • -n:輸出行號
    • -v:輸出沒有‘搜尋字串’的資料
    • --color=auto:幫文字上色

grep 'rich' 把有“rich"的行全部取下來。
grep -v 'rich' 把沒有“rich"的行全部取下來。
搭配正規表示法,才能真正發揮 grep 的實力。


#筆記







Related Posts

JS input 事件介紹

JS input 事件介紹

如何使用 Python Tkinter 製作 GUI 應用程式入門教學

如何使用 Python Tkinter 製作 GUI 應用程式入門教學

linkedin Java 檢定題庫 static

linkedin Java 檢定題庫 static


Comments